/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package CONTROLLER;

import BUS.ChitietdonhangBUS;
import BUS.DonhangBUS;
import BUS.SanphammoiBUS;
import BUS.TinhtrangdonhangBUS;
import POJO.Donhang;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 *
 * @author nhlvu07db373
 */
@Controller
public class PhanhoiController {

    private SanphammoiBUS spmBUS;

    @RequestMapping(value = "/quanliphanhoi")
    public ModelAndView phanhoiShow(HttpServletRequest request, HttpServletResponse response) throws Exception {
        response.setContentType("text/html;charset=UTF-8");
        request.setCharacterEncoding("UTF-8");
        Map<String, Object> mv = new HashMap<String, Object>();
        //Do something...
        try {
            mv.put("lstSPM", spmBUS.dsSanphammoiAll());
        } catch (Exception ex) {
            System.err.print(ex);
        }
        return new ModelAndView("quanliphanhoiview", mv);
    }

    /**
     * @param spmBUS the spmBUS to set
     */
    @Autowired
    public void setSpmBUS(SanphammoiBUS spmBUS) {
        this.spmBUS = spmBUS;
    }
}
